package com.actionpals.utils
{
	import com.actionpals.graphics.Gradient;
	
	import flash.display.GradientType;
	import flash.geom.Matrix;
	
	public class GradientUtil
	{
		public static function getLinearAlpha( width:Number, height:Number, startAlpha:Number = 1, endAlpha:Number = 0 ):Gradient
		{
			var gradient:Gradient = new Gradient();
			var matrix:Matrix = new Matrix();
			
			matrix.createGradientBox( width, height, Math.PI / 2 );
			
			gradient.type = GradientType.LINEAR;
			gradient.colors = [ 0x000000, 0x000000 ];
			gradient.alphas = [ startAlpha, endAlpha ];
			gradient.ratios = [ 0, 255 ];
			gradient.matrix = matrix;
			
			return gradient;
		}
	}
}